package com.xxx.rpc.sample.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xxx.rpc.common.annos.Reference;
import com.xxx.rpc.sample.remote.HelloService;
import com.xxx.rpc.sample.remote.MixService;
import com.xxx.rpc.sample.remote.WarpRpcService;

@RestController
public class DemoController {
	@Resource
	private MixService mixService;

	@Reference // (version = "sample.hello2")
	private HelloService helloService;
	@Reference // (version = "sample.hello2")
	private WarpRpcService warpRpcService;

	@GetMapping("/demo")
	public String case01() {
		return mixService.mix(1, 2);
	}
	@GetMapping("/demo3")
	public String case03() {
		return helloService.hello("aa");
	}
	
	@GetMapping("/demo1")
	public String case02() {
		return helloService.hello("aaa ")+warpRpcService.warp(1, 2);
	}
}
